j3deditor.bin.hierarchy
Class J3DePrimitive

java.lang.Object
  extended by j3deditor.bin.hierarchy.HierarchyNode
      extended by j3deditor.bin.hierarchy.J3DeObject
          extended by j3deditor.bin.hierarchy.J3DePrimitive
All Implemented Interfaces:
Copyable, Cuttable, Deletable

public class J3DePrimitive
extends J3DeObject

Contains and manages an instance of com.sun.j3d.utils.geometry.Primitive.

Author:
Risto Seene
See Also:
Primitive

Constructor Summary
J3DePrimitive()
          Creates an empty J3DePrimitive object.
J3DePrimitive(PrimitiveType type)
          Creates an instance of J3DePrimitive with the given type.
 
Method Summary
 HierarchyNode clone(HierarchyNode node)
          Clones this node.
 J3DeAppearance getAppearance()
          Returns the appearance object of this node.
 HierarchyNode getChild(int index)
          Returns the child at the specified index.
 int getIndexOfChild(HierarchyNode child)
          Returns the index of specified child.
 int getNumberOfChildren()
          Returns the number of children.
 void init3DObject(javax.media.j3d.Node obj)
          Applies the given Node object to this node.
 
Methods inherited from class j3deditor.bin.hierarchy.J3DeObject
delete, get3DObject, getObject, getRotationZ, getRotationX, getRotationY, getScaleZ, getScaleX, getScaleY, getTranslationZ, getTranslationX, getTranslationY, initObject, rotate, rotateZ, rotateX, rotateY, scale, scaleAll, scaleZ, scaleX, scaleY, setNode, setObject, translate, translateZ, translateX, translateY
 
Methods inherited from class j3deditor.bin.hierarchy.HierarchyNode
equals, getIndex, getParent, getParent, getType, hasNamedChild, removeChild, setName, setParent, toString, updateName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

J3DePrimitive

public J3DePrimitive()
Creates an empty J3DePrimitive object. Requires initialization with init3DObject() method


J3DePrimitive

public J3DePrimitive(PrimitiveType type)
Creates an instance of J3DePrimitive with the given type.

Parameters:
type - the type of the primitive
Method Detail

init3DObject

public void init3DObject(javax.media.j3d.Node obj)
Applies the given Node object to this node.

Parameters:
obj - object to be applied to this node

clone

public HierarchyNode clone(HierarchyNode node)
Clones this node.

Overrides:
clone in class J3DeObject
Parameters:
node - object sent by subclass, otherwise null
Returns:
Returns the clone of this node

getChild

public HierarchyNode getChild(int index)
Returns the child at the specified index.

Overrides:
getChild in class HierarchyNode
Parameters:
index - index of child
Returns:
Returns the child with the specified index

getNumberOfChildren

public int getNumberOfChildren()
Returns the number of children.

Overrides:
getNumberOfChildren in class HierarchyNode
Returns:
Returns the number of children as integer

getIndexOfChild

public int getIndexOfChild(HierarchyNode child)
Returns the index of specified child.

Overrides:
getIndexOfChild in class HierarchyNode
Parameters:
child - child node which index will be returned
Returns:
Returns the index of specified child

getAppearance

public J3DeAppearance getAppearance()
Returns the appearance object of this node.

Returns:
Returns the appearance object of this node